package com.baymax.security.handler;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 实现登出处理类
 *
 * @Author: baymax
 * @CreateTime: 2023/3/29 13:26
 * @Version: 1.0
 */
@Configuration
public class LogoutSuccessHandler implements org.springframework.security.web.authentication.logout.LogoutSuccessHandler {

    @Override
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
        // 这里可以去清楚用户的令牌token，redis缓存中的用户信息等
    }
}

